In [1]:
!pip install apyori
Requirement already satisfied: apyori in c:\users\adeol\anaconda3\lib\site-packages (1.1.2)
In [2]:
import matplotlib.pyplot as plt
import pandas as pd
from apyori import apriori
import utils
%matplotlib inline
In [3]:
# load the dataset
data = pd.read_csv('Absenteeism_at_work Review Assoc Data.csv')
In [4]:
# Checking the missing value
data.isnull().sum()
Out[4]:
Distance               0
Age Above 50           0
Target Achieved        0
Higher Education       0
Children               0
Social drinker         0
Social smoker          0
Pet                    0
 Healthy Weight        0
Disciplinary Action    0
dtype: int64
In [5]:
data.shape
Out[5]:
(740, 10)
In [6]:
data
Out[6]:
Distance Age Above 50 Target Achieved Higher Education Children Social drinker Social smoker Pet Healthy Weight Disciplinary Action
0 Yes No Yes Yes Yes No No Yes No No
1 Yes No Yes Yes Yes No No Yes No Yes
2 Yes No Yes Yes Yes No No Yes No No
3 Yes No Yes Yes Yes No No Yes No No
4 Yes No Yes Yes Yes No No Yes No No
... ... ... ... ... ... ... ... ... ... ...
735 Yes Yes Yes No Yes Yes No No No No
736 Yes Yes Yes No Yes Yes No No No No
737 Yes Yes Yes No Yes Yes No No No No
738 Yes Yes Yes No Yes Yes No No No No
739 Yes Yes Yes No Yes Yes No No No No

740 rows × 10 columns

In [7]:
# Analyze the dataset
data.head()
Out[7]:
Distance Age Above 50 Target Achieved Higher Education Children Social drinker Social smoker Pet Healthy Weight Disciplinary Action
0 Yes No Yes Yes Yes No No Yes No No
1 Yes No Yes Yes Yes No No Yes No Yes
2 Yes No Yes Yes Yes No No Yes No No
3 Yes No Yes Yes Yes No No Yes No No
4 Yes No Yes Yes Yes No No Yes No No
In [8]:
# Analyze the dataset
data.tail()
Out[8]:
Distance Age Above 50 Target Achieved Higher Education Children Social drinker Social smoker Pet Healthy Weight Disciplinary Action
735 Yes Yes Yes No Yes Yes No No No No
736 Yes Yes Yes No Yes Yes No No No No
737 Yes Yes Yes No Yes Yes No No No No
738 Yes Yes Yes No Yes Yes No No No No
739 Yes Yes Yes No Yes Yes No No No No
In [9]:
# Describe the dataset
data.describe()
Out[9]:
Distance Age Above 50 Target Achieved Higher Education Children Social drinker Social smoker Pet Healthy Weight Disciplinary Action
count 740 740 740 740 740 740 740 740 740 740
unique 2 2 2 2 2 2 2 2 2 2
top No No Yes No Yes Yes No No Yes No
freq 512 694 681 611 442 420 686 460 390 700
In [10]:
# Plot and explore the dataset
yes = (data=='Yes').sum()
no = (data=='No').sum()
factors = pd.concat([yes,no],axis=1,keys=['yes','no'])
ax = factors.plot.bar(stacked=True)
plt.show()
In [11]:
# Creating Sample Absentees
Absentees = [
    ['Distance', 'Children', 'Pet'],
    ['Distance', 'Healthy Weight'],
    ['Children', 'Pet','Target Achieved'],
    ['Children', 'Target Achieved'],
         ]
Absentees
Out[11]:
[['Distance', 'Children', 'Pet'],
 ['Distance', 'Healthy Weight'],
 ['Children', 'Pet', 'Target Achieved'],
 ['Children', 'Target Achieved']]
In [12]:
# Generating association rules
Rules = list(apriori(Absentees, min_support=0.2, min_confidence=0.5))
In [13]:
#Extract the created rules
associationRules = utils.extract(Rules)
rules_df = pd.DataFrame(associationRules, columns=['LHS', 'RHS', 'Support', 'Confidence', 'Lift'])
rules_df
Out[13]:
LHS RHS Support Confidence Lift
0 [] [Children] 0.75 0.750000 1.000000
1 [] [Distance] 0.50 0.500000 1.000000
2 [] [Pet] 0.50 0.500000 1.000000
3 [] [Target Achieved] 0.50 0.500000 1.000000
4 [Distance] [Children] 0.25 0.500000 0.666667
5 [] [Pet, Children] 0.50 0.500000 1.000000
6 [Children] [Pet] 0.50 0.666667 1.333333
7 [Pet] [Children] 0.50 1.000000 1.333333
8 [] [Target Achieved, Children] 0.50 0.500000 1.000000
9 [Children] [Target Achieved] 0.50 0.666667 1.333333
10 [Target Achieved] [Children] 0.50 1.000000 1.333333
11 [Distance] [Healthy Weight] 0.25 0.500000 2.000000
12 [Healthy Weight] [Distance] 0.25 1.000000 2.000000
13 [Distance] [Pet] 0.25 0.500000 1.000000
14 [Pet] [Distance] 0.25 0.500000 1.000000
15 [Pet] [Target Achieved] 0.25 0.500000 1.000000
16 [Target Achieved] [Pet] 0.25 0.500000 1.000000
17 [Distance] [Pet, Children] 0.25 0.500000 1.000000
18 [Pet] [Distance, Children] 0.25 0.500000 2.000000
19 [Distance, Children] [Pet] 0.25 1.000000 2.000000
20 [Pet, Children] [Distance] 0.25 0.500000 1.000000
21 [Distance, Pet] [Children] 0.25 1.000000 1.333333
22 [Pet] [Target Achieved, Children] 0.25 0.500000 1.000000
23 [Target Achieved] [Pet, Children] 0.25 0.500000 1.000000
24 [Pet, Children] [Target Achieved] 0.25 0.500000 1.000000
25 [Target Achieved, Children] [Pet] 0.25 0.500000 1.000000
26 [Target Achieved, Pet] [Children] 0.25 1.000000 1.333333
In [14]:
utils.inspect(associationRules)
The number of associated rules: 27
LHS: [] --> RHS:['Children'], support: 0.75, confidence: 0.75, lift: 1.00
--------------------------------------------------------------------------------
LHS: [] --> RHS:['Distance'], support: 0.50, confidence: 0.50, lift: 1.00
--------------------------------------------------------------------------------
LHS: [] --> RHS:['Pet'], support: 0.50, confidence: 0.50, lift: 1.00
--------------------------------------------------------------------------------
LHS: [] --> RHS:['Target Achieved'], support: 0.50, confidence: 0.50, lift: 1.00
--------------------------------------------------------------------------------
LHS: ['Distance'] --> RHS:['Children'], support: 0.25, confidence: 0.50, lift: 0.67
--------------------------------------------------------------------------------
LHS: [] --> RHS:['Pet', 'Children'], support: 0.50, confidence: 0.50, lift: 1.00
--------------------------------------------------------------------------------
LHS: ['Children'] --> RHS:['Pet'], support: 0.50, confidence: 0.67, lift: 1.33
--------------------------------------------------------------------------------
LHS: ['Pet'] --> RHS:['Children'], support: 0.50, confidence: 1.00, lift: 1.33
--------------------------------------------------------------------------------
LHS: [] --> RHS:['Target Achieved', 'Children'], support: 0.50, confidence: 0.50, lift: 1.00
--------------------------------------------------------------------------------
LHS: ['Children'] --> RHS:['Target Achieved'], support: 0.50, confidence: 0.67, lift: 1.33
--------------------------------------------------------------------------------
LHS: ['Target Achieved'] --> RHS:['Children'], support: 0.50, confidence: 1.00, lift: 1.33
--------------------------------------------------------------------------------
LHS: ['Distance'] --> RHS:['Healthy Weight'], support: 0.25, confidence: 0.50, lift: 2.00
--------------------------------------------------------------------------------
LHS: ['Healthy Weight'] --> RHS:['Distance'], support: 0.25, confidence: 1.00, lift: 2.00
--------------------------------------------------------------------------------
LHS: ['Distance'] --> RHS:['Pet'], support: 0.25, confidence: 0.50, lift: 1.00
--------------------------------------------------------------------------------
LHS: ['Pet'] --> RHS:['Distance'], support: 0.25, confidence: 0.50, lift: 1.00
--------------------------------------------------------------------------------
LHS: ['Pet'] --> RHS:['Target Achieved'], support: 0.25, confidence: 0.50, lift: 1.00
--------------------------------------------------------------------------------
LHS: ['Target Achieved'] --> RHS:['Pet'], support: 0.25, confidence: 0.50, lift: 1.00
--------------------------------------------------------------------------------
LHS: ['Distance'] --> RHS:['Pet', 'Children'], support: 0.25, confidence: 0.50, lift: 1.00
--------------------------------------------------------------------------------
LHS: ['Pet'] --> RHS:['Distance', 'Children'], support: 0.25, confidence: 0.50, lift: 2.00
--------------------------------------------------------------------------------
LHS: ['Distance', 'Children'] --> RHS:['Pet'], support: 0.25, confidence: 1.00, lift: 2.00
--------------------------------------------------------------------------------
LHS: ['Pet', 'Children'] --> RHS:['Distance'], support: 0.25, confidence: 0.50, lift: 1.00
--------------------------------------------------------------------------------
LHS: ['Distance', 'Pet'] --> RHS:['Children'], support: 0.25, confidence: 1.00, lift: 1.33
--------------------------------------------------------------------------------
LHS: ['Pet'] --> RHS:['Target Achieved', 'Children'], support: 0.25, confidence: 0.50, lift: 1.00
--------------------------------------------------------------------------------
LHS: ['Target Achieved'] --> RHS:['Pet', 'Children'], support: 0.25, confidence: 0.50, lift: 1.00
--------------------------------------------------------------------------------
LHS: ['Pet', 'Children'] --> RHS:['Target Achieved'], support: 0.25, confidence: 0.50, lift: 1.00
--------------------------------------------------------------------------------
LHS: ['Target Achieved', 'Children'] --> RHS:['Pet'], support: 0.25, confidence: 0.50, lift: 1.00
--------------------------------------------------------------------------------
LHS: ['Target Achieved', 'Pet'] --> RHS:['Children'], support: 0.25, confidence: 1.00, lift: 1.33
--------------------------------------------------------------------------------
In [15]:
# Pre process the main dataset
Absentees = utils.data_prepare(data)
In [16]:
# Create association rules on the main dataset
Rules = list(apriori(Absentees, min_support=0.02, min_confidence=0.2))
associationRules = utils.extract(Rules)
rules_df = pd.DataFrame(associationRules, columns=['LHS', 'RHS', 'Support', 'Confidence', 'Lift'])
len(rules_df)
Out[16]:
643
In [17]:
rules_df.nlargest(10, 'Lift')
Out[17]:
LHS RHS Support Confidence Lift
572 [Target Achieved, Social smoker] [Higher Education, Healthy Weight, Children] 0.027027 0.377358 10.342418
573 [Higher Education, Healthy Weight, Children] [Target Achieved, Social smoker] 0.027027 0.740741 10.342418
453 [Higher Education, Children] [Distance, Pet] 0.036486 0.500000 10.277778
455 [Distance, Pet] [Higher Education, Children] 0.036486 0.750000 10.277778
636 [Distance, Pet, Target Achieved] [Higher Education, Children] 0.035135 0.742857 10.179894
624 [Higher Education, Children] [Distance, Target Achieved, Pet] 0.035135 0.481481 10.179894
299 [Social smoker] [Higher Education, Healthy Weight, Children] 0.027027 0.370370 10.150892
304 [Higher Education, Healthy Weight, Children] [Social smoker] 0.027027 0.740741 10.150892
567 [Social smoker] [Higher Education, Target Achieved, Healthy W... 0.027027 0.370370 10.150892
583 [Target Achieved, Higher Education, Healthy W... [Social smoker] 0.027027 0.740741 10.150892
In [18]:
rules_df.nlargest(10, 'Support')
Out[18]:
LHS RHS Support Confidence Lift
5 [] [Target Achieved] 0.920270 0.920270 1.000000
1 [] [Children] 0.597297 0.597297 1.000000
4 [] [Social drinker] 0.567568 0.567568 1.000000
39 [] [Target Achieved, Children] 0.547297 0.547297 1.000000
40 [Children] [Target Achieved] 0.547297 0.916290 0.995674
41 [Target Achieved] [Children] 0.547297 0.594714 0.995674
0 [] [ Healthy Weight] 0.527027 0.527027 1.000000
62 [] [Social drinker, Target Achieved] 0.505405 0.505405 1.000000
63 [Social drinker] [Target Achieved] 0.505405 0.890476 0.967625
64 [Target Achieved] [Social drinker] 0.505405 0.549192 0.967625
In [19]:
rules_df.nlargest(10, 'Confidence')
Out[19]:
LHS RHS Support Confidence Lift
81 [Pet, Healthy Weight] [Children] 0.204054 1.0 1.674208
120 [Higher Education, Social smoker] [ Healthy Weight] 0.027027 1.0 1.897436
137 [Social drinker, Social smoker] [ Healthy Weight] 0.027027 1.0 1.897436
154 [Social drinker, Age Above 50] [Children] 0.045946 1.0 1.674208
160 [Social drinker, Age Above 50] [Distance] 0.045946 1.0 3.245614
170 [Pet, Disciplinary Action] [Children] 0.024324 1.0 1.674208
181 [Distance, Pet] [Children] 0.048649 1.0 1.674208
187 [Social drinker, Distance] [Children] 0.148649 1.0 1.674208
195 [Higher Education, Pet] [Children] 0.045946 1.0 1.674208
199 [Higher Education, Social smoker] [Children] 0.027027 1.0 1.674208
In [20]:
rules_df[rules_df['LHS'].apply(lambda x: len(x) > 0)].nlargest(10, 'Support')
Out[20]:
LHS RHS Support Confidence Lift
40 [Children] [Target Achieved] 0.547297 0.916290 0.995674
41 [Target Achieved] [Children] 0.547297 0.594714 0.995674
63 [Social drinker] [Target Achieved] 0.505405 0.890476 0.967625
64 [Target Achieved] [Social drinker] 0.505405 0.549192 0.967625
22 [ Healthy Weight] [Target Achieved] 0.490541 0.930769 1.011409
23 [Target Achieved] [ Healthy Weight] 0.490541 0.533040 1.011409
33 [Children] [Pet] 0.371622 0.622172 1.644312
34 [Pet] [Children] 0.371622 0.982143 1.644312
36 [Children] [Social drinker] 0.360811 0.604072 1.064318
37 [Social drinker] [Children] 0.360811 0.635714 1.064318
In [21]:
# Create association rules on the main dataset
Rules = list(apriori(Absentees, min_support=0.02, min_confidence=0.2, max_length=3))
associationRules = utils.extract(Rules)
rules_df = pd.DataFrame(associationRules, columns=['LHS', 'RHS', 'Support', 'Confidence', 'Lift'])
len(rules_df)
Out[21]:
267
In [22]:
rules_df.nlargest(10, 'Lift')
Out[22]:
LHS RHS Support Confidence Lift
196 [Social smoker] [Higher Education, Children] 0.027027 0.370370 5.075446
197 [Higher Education, Children] [Social smoker] 0.027027 0.370370 5.075446
158 [Age Above 50] [Social drinker, Distance] 0.045946 0.739130 4.972332
161 [Social drinker, Distance] [Age Above 50] 0.045946 0.309091 4.972332
151 [Distance, Children] [Age Above 50] 0.056757 0.297872 4.791859
148 [Age Above 50] [Distance, Children] 0.056757 0.913043 4.791859
237 [Distance, Pet] [Higher Education] 0.036486 0.750000 4.302326
235 [Higher Education] [Distance, Pet] 0.036486 0.209302 4.302326
160 [Social drinker, Age Above 50] [Distance] 0.045946 1.000000 3.245614
25 [Age Above 50] [Distance] 0.060811 0.978261 3.175057
In [23]:
rules_df.nlargest(10, 'Support')
Out[23]:
LHS RHS Support Confidence Lift
5 [] [Target Achieved] 0.920270 0.920270 1.000000
1 [] [Children] 0.597297 0.597297 1.000000
4 [] [Social drinker] 0.567568 0.567568 1.000000
39 [] [Target Achieved, Children] 0.547297 0.547297 1.000000
40 [Children] [Target Achieved] 0.547297 0.916290 0.995674
41 [Target Achieved] [Children] 0.547297 0.594714 0.995674
0 [] [ Healthy Weight] 0.527027 0.527027 1.000000
62 [] [Social drinker, Target Achieved] 0.505405 0.505405 1.000000
63 [Social drinker] [Target Achieved] 0.505405 0.890476 0.967625
64 [Target Achieved] [Social drinker] 0.505405 0.549192 0.967625
In [24]:
rules_df.nlargest(10, 'Confidence')
Out[24]:
LHS RHS Support Confidence Lift
81 [Pet, Healthy Weight] [Children] 0.204054 1.0 1.674208
120 [Higher Education, Social smoker] [ Healthy Weight] 0.027027 1.0 1.897436
137 [Social drinker, Social smoker] [ Healthy Weight] 0.027027 1.0 1.897436
154 [Social drinker, Age Above 50] [Children] 0.045946 1.0 1.674208
160 [Social drinker, Age Above 50] [Distance] 0.045946 1.0 3.245614
170 [Pet, Disciplinary Action] [Children] 0.024324 1.0 1.674208
181 [Distance, Pet] [Children] 0.048649 1.0 1.674208
187 [Social drinker, Distance] [Children] 0.148649 1.0 1.674208
195 [Higher Education, Pet] [Children] 0.045946 1.0 1.674208
199 [Higher Education, Social smoker] [Children] 0.027027 1.0 1.674208
In [25]:
# Investigate the dataset in more depth
ax = factors.plot.bar()
plt.show()
In [26]:
Rules = list(apriori(Absentees, min_support=0.1, min_confidence=0.95))
associationRules = utils.extract(Rules, 'Target Achieved',2)
utils.inspect(associationRules)
The number of associated rules: 1
LHS: ['Distance', ' Healthy Weight'] --> RHS:['Target Achieved'], support: 0.12, confidence: 0.97, lift: 1.05
--------------------------------------------------------------------------------
In [27]:
Rules = list(apriori(Absentees, min_support=0.01, min_confidence=0.5))
associationRules = utils.extract(Rules, 'Target Achieved',2)
utils.inspect(associationRules)
The number of associated rules: 278
LHS: [' Healthy Weight'] --> RHS:['Target Achieved'], support: 0.49, confidence: 0.93, lift: 1.01
--------------------------------------------------------------------------------
LHS: ['Age Above 50'] --> RHS:['Target Achieved'], support: 0.06, confidence: 0.89, lift: 0.97
--------------------------------------------------------------------------------
LHS: [] --> RHS:['Target Achieved', 'Children'], support: 0.55, confidence: 0.55, lift: 1.00
--------------------------------------------------------------------------------
LHS: ['Children'] --> RHS:['Target Achieved'], support: 0.55, confidence: 0.92, lift: 1.00
--------------------------------------------------------------------------------
LHS: ['Disciplinary Action'] --> RHS:['Target Achieved'], support: 0.05, confidence: 0.93, lift: 1.01
--------------------------------------------------------------------------------
LHS: ['Distance'] --> RHS:['Target Achieved'], support: 0.28, confidence: 0.92, lift: 1.00
--------------------------------------------------------------------------------
LHS: ['Higher Education'] --> RHS:['Target Achieved'], support: 0.16, confidence: 0.94, lift: 1.02
--------------------------------------------------------------------------------
LHS: ['Pet'] --> RHS:['Target Achieved'], support: 0.35, confidence: 0.93, lift: 1.01
--------------------------------------------------------------------------------
LHS: [] --> RHS:['Social drinker', 'Target Achieved'], support: 0.51, confidence: 0.51, lift: 1.00
--------------------------------------------------------------------------------
LHS: ['Social drinker'] --> RHS:['Target Achieved'], support: 0.51, confidence: 0.89, lift: 0.97
--------------------------------------------------------------------------------
LHS: ['Social smoker'] --> RHS:['Target Achieved'], support: 0.07, confidence: 0.98, lift: 1.07
--------------------------------------------------------------------------------
LHS: ['Age Above 50', ' Healthy Weight'] --> RHS:['Target Achieved'], support: 0.02, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: [' Healthy Weight'] --> RHS:['Target Achieved', 'Children'], support: 0.34, confidence: 0.64, lift: 1.18
--------------------------------------------------------------------------------
LHS: ['Children'] --> RHS:['Target Achieved', ' Healthy Weight'], support: 0.34, confidence: 0.57, lift: 1.16
--------------------------------------------------------------------------------
LHS: [' Healthy Weight', 'Children'] --> RHS:['Target Achieved'], support: 0.34, confidence: 0.95, lift: 1.03
--------------------------------------------------------------------------------
LHS: ['Disciplinary Action'] --> RHS:['Target Achieved', ' Healthy Weight'], support: 0.03, confidence: 0.55, lift: 1.12
--------------------------------------------------------------------------------
LHS: ['Disciplinary Action', ' Healthy Weight'] --> RHS:['Target Achieved'], support: 0.03, confidence: 0.92, lift: 1.00
--------------------------------------------------------------------------------
LHS: ['Distance', ' Healthy Weight'] --> RHS:['Target Achieved'], support: 0.12, confidence: 0.97, lift: 1.05
--------------------------------------------------------------------------------
LHS: ['Higher Education'] --> RHS:['Target Achieved', ' Healthy Weight'], support: 0.13, confidence: 0.74, lift: 1.50
--------------------------------------------------------------------------------
LHS: ['Higher Education', ' Healthy Weight'] --> RHS:['Target Achieved'], support: 0.13, confidence: 0.93, lift: 1.01
--------------------------------------------------------------------------------
LHS: ['Pet'] --> RHS:['Target Achieved', ' Healthy Weight'], support: 0.19, confidence: 0.51, lift: 1.04
--------------------------------------------------------------------------------
LHS: ['Pet', ' Healthy Weight'] --> RHS:['Target Achieved'], support: 0.19, confidence: 0.95, lift: 1.03
--------------------------------------------------------------------------------
LHS: ['Social drinker', ' Healthy Weight'] --> RHS:['Target Achieved'], support: 0.22, confidence: 0.90, lift: 0.97
--------------------------------------------------------------------------------
LHS: ['Social smoker'] --> RHS:['Target Achieved', ' Healthy Weight'], support: 0.06, confidence: 0.87, lift: 1.77
--------------------------------------------------------------------------------
LHS: ['Social smoker', ' Healthy Weight'] --> RHS:['Target Achieved'], support: 0.06, confidence: 0.98, lift: 1.06
--------------------------------------------------------------------------------
LHS: ['Age Above 50'] --> RHS:['Target Achieved', 'Children'], support: 0.05, confidence: 0.83, lift: 1.51
--------------------------------------------------------------------------------
LHS: ['Age Above 50', 'Children'] --> RHS:['Target Achieved'], support: 0.05, confidence: 0.88, lift: 0.96
--------------------------------------------------------------------------------
LHS: ['Age Above 50'] --> RHS:['Distance', 'Target Achieved'], support: 0.05, confidence: 0.87, lift: 3.06
--------------------------------------------------------------------------------
LHS: ['Age Above 50', 'Distance'] --> RHS:['Target Achieved'], support: 0.05, confidence: 0.89, lift: 0.97
--------------------------------------------------------------------------------
LHS: ['Age Above 50', 'Pet'] --> RHS:['Target Achieved'], support: 0.01, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: ['Age Above 50'] --> RHS:['Social drinker', 'Target Achieved'], support: 0.04, confidence: 0.63, lift: 1.25
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Age Above 50'] --> RHS:['Target Achieved'], support: 0.04, confidence: 0.85, lift: 0.93
--------------------------------------------------------------------------------
LHS: ['Disciplinary Action'] --> RHS:['Target Achieved', 'Children'], support: 0.04, confidence: 0.72, lift: 1.32
--------------------------------------------------------------------------------
LHS: ['Disciplinary Action', 'Children'] --> RHS:['Target Achieved'], support: 0.04, confidence: 0.94, lift: 1.02
--------------------------------------------------------------------------------
LHS: ['Distance'] --> RHS:['Target Achieved', 'Children'], support: 0.17, confidence: 0.55, lift: 1.00
--------------------------------------------------------------------------------
LHS: ['Distance', 'Children'] --> RHS:['Target Achieved'], support: 0.17, confidence: 0.89, lift: 0.96
--------------------------------------------------------------------------------
LHS: ['Higher Education', 'Children'] --> RHS:['Target Achieved'], support: 0.07, confidence: 0.98, lift: 1.07
--------------------------------------------------------------------------------
LHS: ['Children'] --> RHS:['Target Achieved', 'Pet'], support: 0.35, confidence: 0.58, lift: 1.64
--------------------------------------------------------------------------------
LHS: ['Pet'] --> RHS:['Target Achieved', 'Children'], support: 0.35, confidence: 0.91, lift: 1.67
--------------------------------------------------------------------------------
LHS: ['Pet', 'Children'] --> RHS:['Target Achieved'], support: 0.35, confidence: 0.93, lift: 1.01
--------------------------------------------------------------------------------
LHS: ['Children'] --> RHS:['Social drinker', 'Target Achieved'], support: 0.32, confidence: 0.53, lift: 1.05
--------------------------------------------------------------------------------
LHS: ['Social drinker'] --> RHS:['Target Achieved', 'Children'], support: 0.32, confidence: 0.56, lift: 1.02
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Children'] --> RHS:['Target Achieved'], support: 0.32, confidence: 0.88, lift: 0.95
--------------------------------------------------------------------------------
LHS: ['Social smoker'] --> RHS:['Target Achieved', 'Children'], support: 0.06, confidence: 0.87, lift: 1.59
--------------------------------------------------------------------------------
LHS: ['Social smoker', 'Children'] --> RHS:['Target Achieved'], support: 0.06, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: ['Distance', 'Disciplinary Action'] --> RHS:['Target Achieved'], support: 0.02, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: ['Pet', 'Disciplinary Action'] --> RHS:['Target Achieved'], support: 0.02, confidence: 0.94, lift: 1.03
--------------------------------------------------------------------------------
LHS: ['Disciplinary Action'] --> RHS:['Social drinker', 'Target Achieved'], support: 0.04, confidence: 0.72, lift: 1.43
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Disciplinary Action'] --> RHS:['Target Achieved'], support: 0.04, confidence: 0.91, lift: 0.98
--------------------------------------------------------------------------------
LHS: ['Higher Education', 'Distance'] --> RHS:['Target Achieved'], support: 0.07, confidence: 0.98, lift: 1.07
--------------------------------------------------------------------------------
LHS: ['Distance', 'Pet'] --> RHS:['Target Achieved'], support: 0.05, confidence: 0.97, lift: 1.06
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Distance'] --> RHS:['Target Achieved'], support: 0.13, confidence: 0.86, lift: 0.94
--------------------------------------------------------------------------------
LHS: ['Distance', 'Social smoker'] --> RHS:['Target Achieved'], support: 0.01, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: ['Higher Education', 'Pet'] --> RHS:['Target Achieved'], support: 0.04, confidence: 0.97, lift: 1.05
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Higher Education'] --> RHS:['Target Achieved'], support: 0.01, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: ['Higher Education', 'Social smoker'] --> RHS:['Target Achieved'], support: 0.03, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Pet'] --> RHS:['Target Achieved'], support: 0.14, confidence: 0.87, lift: 0.95
--------------------------------------------------------------------------------
LHS: ['Pet', 'Social smoker'] --> RHS:['Target Achieved'], support: 0.03, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Social smoker'] --> RHS:['Target Achieved'], support: 0.03, confidence: 0.95, lift: 1.03
--------------------------------------------------------------------------------
LHS: ['Age Above 50', ' Healthy Weight'] --> RHS:['Target Achieved', 'Children'], support: 0.01, confidence: 0.75, lift: 1.37
--------------------------------------------------------------------------------
LHS: ['Age Above 50', ' Healthy Weight', 'Children'] --> RHS:['Target Achieved'], support: 0.01, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: ['Age Above 50', ' Healthy Weight'] --> RHS:['Distance', 'Target Achieved'], support: 0.01, confidence: 0.92, lift: 3.23
--------------------------------------------------------------------------------
LHS: ['Age Above 50', 'Distance', ' Healthy Weight'] --> RHS:['Target Achieved'], support: 0.01, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: ['Age Above 50', ' Healthy Weight'] --> RHS:['Target Achieved', 'Pet'], support: 0.01, confidence: 0.75, lift: 2.13
--------------------------------------------------------------------------------
LHS: ['Age Above 50', 'Pet'] --> RHS:['Target Achieved', ' Healthy Weight'], support: 0.01, confidence: 1.00, lift: 2.04
--------------------------------------------------------------------------------
LHS: ['Age Above 50', 'Pet', ' Healthy Weight'] --> RHS:['Target Achieved'], support: 0.01, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: ['Disciplinary Action'] --> RHS:['Target Achieved', ' Healthy Weight', 'Children'], support: 0.03, confidence: 0.53, lift: 1.55
--------------------------------------------------------------------------------
LHS: ['Disciplinary Action', ' Healthy Weight'] --> RHS:['Target Achieved', 'Children'], support: 0.03, confidence: 0.88, lift: 1.60
--------------------------------------------------------------------------------
LHS: ['Disciplinary Action', 'Children'] --> RHS:['Target Achieved', ' Healthy Weight'], support: 0.03, confidence: 0.68, lift: 1.38
--------------------------------------------------------------------------------
LHS: ['Disciplinary Action', ' Healthy Weight', 'Children'] --> RHS:['Target Achieved'], support: 0.03, confidence: 0.91, lift: 0.99
--------------------------------------------------------------------------------
LHS: ['Distance', ' Healthy Weight'] --> RHS:['Target Achieved', 'Children'], support: 0.08, confidence: 0.62, lift: 1.13
--------------------------------------------------------------------------------
LHS: ['Distance', ' Healthy Weight', 'Children'] --> RHS:['Target Achieved'], support: 0.08, confidence: 0.95, lift: 1.03
--------------------------------------------------------------------------------
LHS: ['Higher Education', 'Children'] --> RHS:['Target Achieved', ' Healthy Weight'], support: 0.04, confidence: 0.50, lift: 1.02
--------------------------------------------------------------------------------
LHS: ['Higher Education', ' Healthy Weight', 'Children'] --> RHS:['Target Achieved'], support: 0.04, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: ['Pet'] --> RHS:['Target Achieved', ' Healthy Weight', 'Children'], support: 0.19, confidence: 0.51, lift: 1.51
--------------------------------------------------------------------------------
LHS: [' Healthy Weight', 'Children'] --> RHS:['Target Achieved', 'Pet'], support: 0.19, confidence: 0.54, lift: 1.53
--------------------------------------------------------------------------------
LHS: ['Pet', ' Healthy Weight'] --> RHS:['Target Achieved', 'Children'], support: 0.19, confidence: 0.95, lift: 1.73
--------------------------------------------------------------------------------
LHS: ['Pet', 'Children'] --> RHS:['Target Achieved', ' Healthy Weight'], support: 0.19, confidence: 0.52, lift: 1.06
--------------------------------------------------------------------------------
LHS: ['Pet', ' Healthy Weight', 'Children'] --> RHS:['Target Achieved'], support: 0.19, confidence: 0.95, lift: 1.03
--------------------------------------------------------------------------------
LHS: ['Social drinker', ' Healthy Weight'] --> RHS:['Target Achieved', 'Children'], support: 0.18, confidence: 0.71, lift: 1.30
--------------------------------------------------------------------------------
LHS: ['Social drinker', ' Healthy Weight', 'Children'] --> RHS:['Target Achieved'], support: 0.18, confidence: 0.91, lift: 0.99
--------------------------------------------------------------------------------
LHS: ['Social smoker'] --> RHS:['Target Achieved', ' Healthy Weight', 'Children'], support: 0.06, confidence: 0.76, lift: 2.24
--------------------------------------------------------------------------------
LHS: ['Social smoker', ' Healthy Weight'] --> RHS:['Target Achieved', 'Children'], support: 0.06, confidence: 0.85, lift: 1.56
--------------------------------------------------------------------------------
LHS: ['Social smoker', 'Children'] --> RHS:['Target Achieved', ' Healthy Weight'], support: 0.06, confidence: 0.87, lift: 1.78
--------------------------------------------------------------------------------
LHS: ['Social smoker', ' Healthy Weight', 'Children'] --> RHS:['Target Achieved'], support: 0.06, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: ['Pet', 'Disciplinary Action'] --> RHS:['Target Achieved', ' Healthy Weight'], support: 0.01, confidence: 0.61, lift: 1.25
--------------------------------------------------------------------------------
LHS: ['Disciplinary Action', 'Pet', ' Healthy Weight'] --> RHS:['Target Achieved'], support: 0.01, confidence: 0.92, lift: 1.00
--------------------------------------------------------------------------------
LHS: ['Disciplinary Action', ' Healthy Weight'] --> RHS:['Social drinker', 'Target Achieved'], support: 0.02, confidence: 0.71, lift: 1.40
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Disciplinary Action'] --> RHS:['Target Achieved', ' Healthy Weight'], support: 0.02, confidence: 0.53, lift: 1.08
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Disciplinary Action', ' Healthy Weight'] --> RHS:['Target Achieved'], support: 0.02, confidence: 0.89, lift: 0.97
--------------------------------------------------------------------------------
LHS: ['Higher Education', 'Distance'] --> RHS:['Target Achieved', ' Healthy Weight'], support: 0.04, confidence: 0.52, lift: 1.06
--------------------------------------------------------------------------------
LHS: ['Higher Education', 'Distance', ' Healthy Weight'] --> RHS:['Target Achieved'], support: 0.04, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: ['Distance', 'Pet', ' Healthy Weight'] --> RHS:['Target Achieved'], support: 0.01, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: ['Distance', ' Healthy Weight'] --> RHS:['Social drinker', 'Target Achieved'], support: 0.07, confidence: 0.53, lift: 1.05
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Distance', ' Healthy Weight'] --> RHS:['Target Achieved'], support: 0.07, confidence: 0.94, lift: 1.02
--------------------------------------------------------------------------------
LHS: ['Distance', 'Social smoker'] --> RHS:['Target Achieved', ' Healthy Weight'], support: 0.01, confidence: 1.00, lift: 2.04
--------------------------------------------------------------------------------
LHS: ['Distance', 'Social smoker', ' Healthy Weight'] --> RHS:['Target Achieved'], support: 0.01, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: ['Higher Education', 'Social smoker'] --> RHS:['Target Achieved', ' Healthy Weight'], support: 0.03, confidence: 1.00, lift: 2.04
--------------------------------------------------------------------------------
LHS: ['Higher Education', 'Social smoker', ' Healthy Weight'] --> RHS:['Target Achieved'], support: 0.03, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Pet', ' Healthy Weight'] --> RHS:['Target Achieved'], support: 0.06, confidence: 0.86, lift: 0.93
--------------------------------------------------------------------------------
LHS: ['Pet', 'Social smoker'] --> RHS:['Target Achieved', ' Healthy Weight'], support: 0.02, confidence: 0.68, lift: 1.39
--------------------------------------------------------------------------------
LHS: ['Pet', 'Social smoker', ' Healthy Weight'] --> RHS:['Target Achieved'], support: 0.02, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Social smoker'] --> RHS:['Target Achieved', ' Healthy Weight'], support: 0.03, confidence: 0.95, lift: 1.94
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Social smoker', ' Healthy Weight'] --> RHS:['Target Achieved'], support: 0.03, confidence: 0.95, lift: 1.03
--------------------------------------------------------------------------------
LHS: ['Age Above 50'] --> RHS:['Distance', 'Target Achieved', 'Children'], support: 0.05, confidence: 0.80, lift: 4.76
--------------------------------------------------------------------------------
LHS: ['Age Above 50', 'Children'] --> RHS:['Distance', 'Target Achieved'], support: 0.05, confidence: 0.86, lift: 3.03
--------------------------------------------------------------------------------
LHS: ['Age Above 50', 'Distance'] --> RHS:['Target Achieved', 'Children'], support: 0.05, confidence: 0.82, lift: 1.50
--------------------------------------------------------------------------------
LHS: ['Age Above 50', 'Distance', 'Children'] --> RHS:['Target Achieved'], support: 0.05, confidence: 0.88, lift: 0.96
--------------------------------------------------------------------------------
LHS: ['Age Above 50', 'Pet'] --> RHS:['Target Achieved', 'Children'], support: 0.01, confidence: 1.00, lift: 1.83
--------------------------------------------------------------------------------
LHS: ['Age Above 50', 'Pet', 'Children'] --> RHS:['Target Achieved'], support: 0.01, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: ['Age Above 50'] --> RHS:['Social drinker', 'Target Achieved', 'Children'], support: 0.04, confidence: 0.63, lift: 1.99
--------------------------------------------------------------------------------
LHS: ['Age Above 50', 'Children'] --> RHS:['Social drinker', 'Target Achieved'], support: 0.04, confidence: 0.67, lift: 1.33
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Age Above 50'] --> RHS:['Target Achieved', 'Children'], support: 0.04, confidence: 0.85, lift: 1.56
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Age Above 50', 'Children'] --> RHS:['Target Achieved'], support: 0.04, confidence: 0.85, lift: 0.93
--------------------------------------------------------------------------------
LHS: ['Age Above 50', 'Pet'] --> RHS:['Distance', 'Target Achieved'], support: 0.01, confidence: 0.89, lift: 3.13
--------------------------------------------------------------------------------
LHS: ['Age Above 50', 'Distance', 'Pet'] --> RHS:['Target Achieved'], support: 0.01, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: ['Age Above 50'] --> RHS:['Social drinker', 'Distance', 'Target Achieved'], support: 0.04, confidence: 0.63, lift: 4.91
--------------------------------------------------------------------------------
LHS: ['Age Above 50', 'Distance'] --> RHS:['Social drinker', 'Target Achieved'], support: 0.04, confidence: 0.64, lift: 1.28
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Age Above 50'] --> RHS:['Distance', 'Target Achieved'], support: 0.04, confidence: 0.85, lift: 3.01
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Age Above 50', 'Distance'] --> RHS:['Target Achieved'], support: 0.04, confidence: 0.85, lift: 0.93
--------------------------------------------------------------------------------
LHS: ['Distance', 'Disciplinary Action'] --> RHS:['Target Achieved', 'Children'], support: 0.01, confidence: 0.83, lift: 1.52
--------------------------------------------------------------------------------
LHS: ['Distance', 'Disciplinary Action', 'Children'] --> RHS:['Target Achieved'], support: 0.01, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: ['Disciplinary Action', 'Children'] --> RHS:['Target Achieved', 'Pet'], support: 0.02, confidence: 0.55, lift: 1.55
--------------------------------------------------------------------------------
LHS: ['Pet', 'Disciplinary Action'] --> RHS:['Target Achieved', 'Children'], support: 0.02, confidence: 0.94, lift: 1.73
--------------------------------------------------------------------------------
LHS: ['Pet', 'Disciplinary Action', 'Children'] --> RHS:['Target Achieved'], support: 0.02, confidence: 0.94, lift: 1.03
--------------------------------------------------------------------------------
LHS: ['Disciplinary Action'] --> RHS:['Social drinker', 'Target Achieved', 'Children'], support: 0.03, confidence: 0.60, lift: 1.90
--------------------------------------------------------------------------------
LHS: ['Disciplinary Action', 'Children'] --> RHS:['Social drinker', 'Target Achieved'], support: 0.03, confidence: 0.77, lift: 1.53
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Disciplinary Action'] --> RHS:['Target Achieved', 'Children'], support: 0.03, confidence: 0.75, lift: 1.37
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Disciplinary Action', 'Children'] --> RHS:['Target Achieved'], support: 0.03, confidence: 0.92, lift: 1.00
--------------------------------------------------------------------------------
LHS: ['Higher Education', 'Distance', 'Children'] --> RHS:['Target Achieved'], support: 0.04, confidence: 0.96, lift: 1.05
--------------------------------------------------------------------------------
LHS: ['Distance', 'Pet'] --> RHS:['Target Achieved', 'Children'], support: 0.05, confidence: 0.97, lift: 1.78
--------------------------------------------------------------------------------
LHS: ['Distance', 'Pet', 'Children'] --> RHS:['Target Achieved'], support: 0.05, confidence: 0.97, lift: 1.06
--------------------------------------------------------------------------------
LHS: ['Distance', 'Children'] --> RHS:['Social drinker', 'Target Achieved'], support: 0.13, confidence: 0.67, lift: 1.33
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Distance'] --> RHS:['Target Achieved', 'Children'], support: 0.13, confidence: 0.86, lift: 1.58
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Distance', 'Children'] --> RHS:['Target Achieved'], support: 0.13, confidence: 0.86, lift: 0.94
--------------------------------------------------------------------------------
LHS: ['Distance', 'Social smoker'] --> RHS:['Target Achieved', 'Children'], support: 0.01, confidence: 1.00, lift: 1.83
--------------------------------------------------------------------------------
LHS: ['Distance', 'Social smoker', 'Children'] --> RHS:['Target Achieved'], support: 0.01, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: ['Higher Education', 'Children'] --> RHS:['Target Achieved', 'Pet'], support: 0.04, confidence: 0.61, lift: 1.73
--------------------------------------------------------------------------------
LHS: ['Higher Education', 'Pet'] --> RHS:['Target Achieved', 'Children'], support: 0.04, confidence: 0.97, lift: 1.77
--------------------------------------------------------------------------------
LHS: ['Higher Education', 'Pet', 'Children'] --> RHS:['Target Achieved'], support: 0.04, confidence: 0.97, lift: 1.05
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Higher Education'] --> RHS:['Target Achieved', 'Children'], support: 0.01, confidence: 1.00, lift: 1.83
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Higher Education', 'Children'] --> RHS:['Target Achieved'], support: 0.01, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: ['Higher Education', 'Social smoker'] --> RHS:['Target Achieved', 'Children'], support: 0.03, confidence: 1.00, lift: 1.83
--------------------------------------------------------------------------------
LHS: ['Higher Education', 'Social smoker', 'Children'] --> RHS:['Target Achieved'], support: 0.03, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Pet'] --> RHS:['Target Achieved', 'Children'], support: 0.14, confidence: 0.87, lift: 1.60
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Pet', 'Children'] --> RHS:['Target Achieved'], support: 0.14, confidence: 0.87, lift: 0.95
--------------------------------------------------------------------------------
LHS: ['Pet', 'Social smoker'] --> RHS:['Target Achieved', 'Children'], support: 0.03, confidence: 1.00, lift: 1.83
--------------------------------------------------------------------------------
LHS: ['Pet', 'Social smoker', 'Children'] --> RHS:['Target Achieved'], support: 0.03, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Social smoker'] --> RHS:['Target Achieved', 'Children'], support: 0.02, confidence: 0.65, lift: 1.19
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Social smoker', 'Children'] --> RHS:['Target Achieved'], support: 0.02, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: ['Distance', 'Disciplinary Action'] --> RHS:['Social drinker', 'Target Achieved'], support: 0.01, confidence: 0.75, lift: 1.48
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Distance', 'Disciplinary Action'] --> RHS:['Target Achieved'], support: 0.01, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: ['Pet', 'Disciplinary Action'] --> RHS:['Social drinker', 'Target Achieved'], support: 0.02, confidence: 0.67, lift: 1.32
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Pet', 'Disciplinary Action'] --> RHS:['Target Achieved'], support: 0.02, confidence: 0.92, lift: 1.00
--------------------------------------------------------------------------------
LHS: ['Distance', 'Pet'] --> RHS:['Higher Education', 'Target Achieved'], support: 0.04, confidence: 0.72, lift: 4.42
--------------------------------------------------------------------------------
LHS: ['Higher Education', 'Pet'] --> RHS:['Distance', 'Target Achieved'], support: 0.04, confidence: 0.76, lift: 2.69
--------------------------------------------------------------------------------
LHS: ['Higher Education', 'Distance', 'Pet'] --> RHS:['Target Achieved'], support: 0.04, confidence: 0.96, lift: 1.05
--------------------------------------------------------------------------------
LHS: ['Distance', 'Social smoker'] --> RHS:['Social drinker', 'Target Achieved'], support: 0.01, confidence: 1.00, lift: 1.98
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Distance', 'Social smoker'] --> RHS:['Target Achieved'], support: 0.01, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Higher Education'] --> RHS:['Target Achieved', 'Pet'], support: 0.01, confidence: 1.00, lift: 2.84
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Higher Education', 'Pet'] --> RHS:['Target Achieved'], support: 0.01, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: ['Age Above 50', ' Healthy Weight'] --> RHS:['Distance', 'Target Achieved', 'Children'], support: 0.01, confidence: 0.67, lift: 3.95
--------------------------------------------------------------------------------
LHS: ['Age Above 50', ' Healthy Weight', 'Children'] --> RHS:['Distance', 'Target Achieved'], support: 0.01, confidence: 0.89, lift: 3.13
--------------------------------------------------------------------------------
LHS: ['Age Above 50', 'Distance', ' Healthy Weight'] --> RHS:['Target Achieved', 'Children'], support: 0.01, confidence: 0.73, lift: 1.33
--------------------------------------------------------------------------------
LHS: ['Age Above 50', 'Distance', ' Healthy Weight', 'Children'] --> RHS:['Target Achieved'], support: 0.01, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: ['Age Above 50', ' Healthy Weight'] --> RHS:['Target Achieved', 'Pet', 'Children'], support: 0.01, confidence: 0.75, lift: 2.17
--------------------------------------------------------------------------------
LHS: ['Age Above 50', 'Pet'] --> RHS:['Target Achieved', ' Healthy Weight', 'Children'], support: 0.01, confidence: 1.00, lift: 2.95
--------------------------------------------------------------------------------
LHS: ['Age Above 50', ' Healthy Weight', 'Children'] --> RHS:['Target Achieved', 'Pet'], support: 0.01, confidence: 1.00, lift: 2.84
--------------------------------------------------------------------------------
LHS: ['Age Above 50', 'Pet', ' Healthy Weight'] --> RHS:['Target Achieved', 'Children'], support: 0.01, confidence: 1.00, lift: 1.83
--------------------------------------------------------------------------------
LHS: ['Age Above 50', 'Pet', 'Children'] --> RHS:['Target Achieved', ' Healthy Weight'], support: 0.01, confidence: 1.00, lift: 2.04
--------------------------------------------------------------------------------
LHS: ['Age Above 50', 'Pet', ' Healthy Weight', 'Children'] --> RHS:['Target Achieved'], support: 0.01, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: ['Age Above 50', ' Healthy Weight'] --> RHS:['Distance', 'Target Achieved', 'Pet'], support: 0.01, confidence: 0.67, lift: 14.10
--------------------------------------------------------------------------------
LHS: ['Age Above 50', 'Pet'] --> RHS:['Distance', 'Target Achieved', ' Healthy Weight'], support: 0.01, confidence: 0.89, lift: 7.39
--------------------------------------------------------------------------------
LHS: ['Age Above 50', 'Distance', ' Healthy Weight'] --> RHS:['Target Achieved', 'Pet'], support: 0.01, confidence: 0.73, lift: 2.06
--------------------------------------------------------------------------------
LHS: ['Age Above 50', 'Pet', ' Healthy Weight'] --> RHS:['Distance', 'Target Achieved'], support: 0.01, confidence: 0.89, lift: 3.13
--------------------------------------------------------------------------------
LHS: ['Distance', 'Pet', ' Healthy Weight'] --> RHS:['Age Above 50', 'Target Achieved'], support: 0.01, confidence: 1.00, lift: 18.05
--------------------------------------------------------------------------------
LHS: ['Age Above 50', 'Distance', 'Pet'] --> RHS:['Target Achieved', ' Healthy Weight'], support: 0.01, confidence: 1.00, lift: 2.04
--------------------------------------------------------------------------------
LHS: ['Age Above 50', 'Distance', 'Pet', ' Healthy Weight'] --> RHS:['Target Achieved'], support: 0.01, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: ['Pet', 'Disciplinary Action'] --> RHS:['Target Achieved', ' Healthy Weight', 'Children'], support: 0.01, confidence: 0.61, lift: 1.80
--------------------------------------------------------------------------------
LHS: ['Disciplinary Action', 'Pet', ' Healthy Weight'] --> RHS:['Target Achieved', 'Children'], support: 0.01, confidence: 0.92, lift: 1.67
--------------------------------------------------------------------------------
LHS: ['Pet', 'Disciplinary Action', 'Children'] --> RHS:['Target Achieved', ' Healthy Weight'], support: 0.01, confidence: 0.61, lift: 1.25
--------------------------------------------------------------------------------
LHS: ['Disciplinary Action', 'Pet', ' Healthy Weight', 'Children'] --> RHS:['Target Achieved'], support: 0.01, confidence: 0.92, lift: 1.00
--------------------------------------------------------------------------------
LHS: ['Disciplinary Action', ' Healthy Weight'] --> RHS:['Social drinker', 'Target Achieved', 'Children'], support: 0.02, confidence: 0.71, lift: 2.24
--------------------------------------------------------------------------------
LHS: ['Disciplinary Action', 'Children'] --> RHS:['Social drinker', 'Target Achieved', ' Healthy Weight'], support: 0.02, confidence: 0.55, lift: 2.47
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Disciplinary Action'] --> RHS:['Target Achieved', ' Healthy Weight', 'Children'], support: 0.02, confidence: 0.53, lift: 1.57
--------------------------------------------------------------------------------
LHS: ['Disciplinary Action', ' Healthy Weight', 'Children'] --> RHS:['Social drinker', 'Target Achieved'], support: 0.02, confidence: 0.74, lift: 1.46
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Disciplinary Action', ' Healthy Weight'] --> RHS:['Target Achieved', 'Children'], support: 0.02, confidence: 0.89, lift: 1.63
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Disciplinary Action', 'Children'] --> RHS:['Target Achieved', ' Healthy Weight'], support: 0.02, confidence: 0.65, lift: 1.33
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Disciplinary Action', ' Healthy Weight', 'Children'] --> RHS:['Target Achieved'], support: 0.02, confidence: 0.89, lift: 0.97
--------------------------------------------------------------------------------
LHS: ['Distance', 'Pet', ' Healthy Weight'] --> RHS:['Target Achieved', 'Children'], support: 0.01, confidence: 1.00, lift: 1.83
--------------------------------------------------------------------------------
LHS: ['Distance', 'Pet', ' Healthy Weight', 'Children'] --> RHS:['Target Achieved'], support: 0.01, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: ['Distance', ' Healthy Weight'] --> RHS:['Social drinker', 'Target Achieved', 'Children'], support: 0.07, confidence: 0.53, lift: 1.68
--------------------------------------------------------------------------------
LHS: ['Distance', ' Healthy Weight', 'Children'] --> RHS:['Social drinker', 'Target Achieved'], support: 0.07, confidence: 0.82, lift: 1.62
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Distance', ' Healthy Weight'] --> RHS:['Target Achieved', 'Children'], support: 0.07, confidence: 0.94, lift: 1.72
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Distance', ' Healthy Weight', 'Children'] --> RHS:['Target Achieved'], support: 0.07, confidence: 0.94, lift: 1.02
--------------------------------------------------------------------------------
LHS: ['Distance', 'Social smoker'] --> RHS:['Target Achieved', ' Healthy Weight', 'Children'], support: 0.01, confidence: 1.00, lift: 2.95
--------------------------------------------------------------------------------
LHS: ['Distance', 'Social smoker', ' Healthy Weight'] --> RHS:['Target Achieved', 'Children'], support: 0.01, confidence: 1.00, lift: 1.83
--------------------------------------------------------------------------------
LHS: ['Distance', 'Social smoker', 'Children'] --> RHS:['Target Achieved', ' Healthy Weight'], support: 0.01, confidence: 1.00, lift: 2.04
--------------------------------------------------------------------------------
LHS: ['Distance', 'Social smoker', ' Healthy Weight', 'Children'] --> RHS:['Target Achieved'], support: 0.01, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: ['Higher Education', 'Social smoker'] --> RHS:['Target Achieved', ' Healthy Weight', 'Children'], support: 0.03, confidence: 1.00, lift: 2.95
--------------------------------------------------------------------------------
LHS: ['Higher Education', ' Healthy Weight', 'Children'] --> RHS:['Target Achieved', 'Social smoker'], support: 0.03, confidence: 0.74, lift: 10.34
--------------------------------------------------------------------------------
LHS: ['Higher Education', 'Social smoker', ' Healthy Weight'] --> RHS:['Target Achieved', 'Children'], support: 0.03, confidence: 1.00, lift: 1.83
--------------------------------------------------------------------------------
LHS: ['Higher Education', 'Social smoker', 'Children'] --> RHS:['Target Achieved', ' Healthy Weight'], support: 0.03, confidence: 1.00, lift: 2.04
--------------------------------------------------------------------------------
LHS: ['Higher Education', 'Social smoker', ' Healthy Weight', 'Children'] --> RHS:['Target Achieved'], support: 0.03, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Pet', ' Healthy Weight'] --> RHS:['Target Achieved', 'Children'], support: 0.06, confidence: 0.86, lift: 1.57
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Pet', ' Healthy Weight', 'Children'] --> RHS:['Target Achieved'], support: 0.06, confidence: 0.86, lift: 0.93
--------------------------------------------------------------------------------
LHS: ['Pet', 'Social smoker'] --> RHS:['Target Achieved', ' Healthy Weight', 'Children'], support: 0.02, confidence: 0.68, lift: 2.02
--------------------------------------------------------------------------------
LHS: ['Pet', 'Social smoker', ' Healthy Weight'] --> RHS:['Target Achieved', 'Children'], support: 0.02, confidence: 1.00, lift: 1.83
--------------------------------------------------------------------------------
LHS: ['Pet', 'Social smoker', 'Children'] --> RHS:['Target Achieved', ' Healthy Weight'], support: 0.02, confidence: 0.68, lift: 1.39
--------------------------------------------------------------------------------
LHS: ['Pet', 'Social smoker', ' Healthy Weight', 'Children'] --> RHS:['Target Achieved'], support: 0.02, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Social smoker'] --> RHS:['Target Achieved', ' Healthy Weight', 'Children'], support: 0.02, confidence: 0.65, lift: 1.92
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Social smoker', ' Healthy Weight'] --> RHS:['Target Achieved', 'Children'], support: 0.02, confidence: 0.65, lift: 1.19
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Social smoker', 'Children'] --> RHS:['Target Achieved', ' Healthy Weight'], support: 0.02, confidence: 1.00, lift: 2.04
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Social smoker', ' Healthy Weight', 'Children'] --> RHS:['Target Achieved'], support: 0.02, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: ['Distance', 'Social smoker'] --> RHS:['Social drinker', 'Target Achieved', ' Healthy Weight'], support: 0.01, confidence: 1.00, lift: 4.51
--------------------------------------------------------------------------------
LHS: ['Distance', 'Social smoker', ' Healthy Weight'] --> RHS:['Social drinker', 'Target Achieved'], support: 0.01, confidence: 1.00, lift: 1.98
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Distance', 'Social smoker'] --> RHS:['Target Achieved', ' Healthy Weight'], support: 0.01, confidence: 1.00, lift: 2.04
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Distance', 'Social smoker', ' Healthy Weight'] --> RHS:['Target Achieved'], support: 0.01, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: ['Age Above 50', 'Pet'] --> RHS:['Distance', 'Target Achieved', 'Children'], support: 0.01, confidence: 0.89, lift: 5.26
--------------------------------------------------------------------------------
LHS: ['Age Above 50', 'Pet', 'Children'] --> RHS:['Distance', 'Target Achieved'], support: 0.01, confidence: 0.89, lift: 3.13
--------------------------------------------------------------------------------
LHS: ['Age Above 50', 'Distance', 'Pet'] --> RHS:['Target Achieved', 'Children'], support: 0.01, confidence: 1.00, lift: 1.83
--------------------------------------------------------------------------------
LHS: ['Age Above 50', 'Distance', 'Pet', 'Children'] --> RHS:['Target Achieved'], support: 0.01, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: ['Age Above 50'] --> RHS:['Social drinker', 'Distance', 'Target Achieved', 'Children'], support: 0.04, confidence: 0.63, lift: 4.91
--------------------------------------------------------------------------------
LHS: ['Age Above 50', 'Children'] --> RHS:['Social drinker', 'Distance', 'Target Achieved'], support: 0.04, confidence: 0.67, lift: 5.25
--------------------------------------------------------------------------------
LHS: ['Age Above 50', 'Distance'] --> RHS:['Social drinker', 'Target Achieved', 'Children'], support: 0.04, confidence: 0.64, lift: 2.04
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Age Above 50'] --> RHS:['Distance', 'Target Achieved', 'Children'], support: 0.04, confidence: 0.85, lift: 5.05
--------------------------------------------------------------------------------
LHS: ['Age Above 50', 'Distance', 'Children'] --> RHS:['Social drinker', 'Target Achieved'], support: 0.04, confidence: 0.69, lift: 1.37
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Age Above 50', 'Children'] --> RHS:['Distance', 'Target Achieved'], support: 0.04, confidence: 0.85, lift: 3.01
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Age Above 50', 'Distance'] --> RHS:['Target Achieved', 'Children'], support: 0.04, confidence: 0.85, lift: 1.56
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Age Above 50', 'Distance', 'Children'] --> RHS:['Target Achieved'], support: 0.04, confidence: 0.85, lift: 0.93
--------------------------------------------------------------------------------
LHS: ['Distance', 'Disciplinary Action'] --> RHS:['Social drinker', 'Target Achieved', 'Children'], support: 0.01, confidence: 0.75, lift: 2.37
--------------------------------------------------------------------------------
LHS: ['Distance', 'Disciplinary Action', 'Children'] --> RHS:['Social drinker', 'Target Achieved'], support: 0.01, confidence: 0.90, lift: 1.78
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Distance', 'Disciplinary Action'] --> RHS:['Target Achieved', 'Children'], support: 0.01, confidence: 1.00, lift: 1.83
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Distance', 'Disciplinary Action', 'Children'] --> RHS:['Target Achieved'], support: 0.01, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: ['Pet', 'Disciplinary Action'] --> RHS:['Social drinker', 'Target Achieved', 'Children'], support: 0.02, confidence: 0.67, lift: 2.11
--------------------------------------------------------------------------------
LHS: ['Pet', 'Disciplinary Action', 'Children'] --> RHS:['Social drinker', 'Target Achieved'], support: 0.02, confidence: 0.67, lift: 1.32
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Pet', 'Disciplinary Action'] --> RHS:['Target Achieved', 'Children'], support: 0.02, confidence: 0.92, lift: 1.69
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Pet', 'Disciplinary Action', 'Children'] --> RHS:['Target Achieved'], support: 0.02, confidence: 0.92, lift: 1.00
--------------------------------------------------------------------------------
LHS: ['Distance', 'Pet'] --> RHS:['Higher Education', 'Target Achieved', 'Children'], support: 0.04, confidence: 0.72, lift: 10.08
--------------------------------------------------------------------------------
LHS: ['Higher Education', 'Pet'] --> RHS:['Distance', 'Target Achieved', 'Children'], support: 0.04, confidence: 0.76, lift: 4.53
--------------------------------------------------------------------------------
LHS: ['Higher Education', 'Distance', 'Children'] --> RHS:['Target Achieved', 'Pet'], support: 0.04, confidence: 0.96, lift: 2.73
--------------------------------------------------------------------------------
LHS: ['Distance', 'Pet', 'Children'] --> RHS:['Higher Education', 'Target Achieved'], support: 0.04, confidence: 0.72, lift: 4.42
--------------------------------------------------------------------------------
LHS: ['Higher Education', 'Pet', 'Children'] --> RHS:['Distance', 'Target Achieved'], support: 0.04, confidence: 0.76, lift: 2.69
--------------------------------------------------------------------------------
LHS: ['Higher Education', 'Distance', 'Pet'] --> RHS:['Target Achieved', 'Children'], support: 0.04, confidence: 0.96, lift: 1.76
--------------------------------------------------------------------------------
LHS: ['Higher Education', 'Distance', 'Pet', 'Children'] --> RHS:['Target Achieved'], support: 0.04, confidence: 0.96, lift: 1.05
--------------------------------------------------------------------------------
LHS: ['Distance', 'Social smoker'] --> RHS:['Social drinker', 'Target Achieved', 'Children'], support: 0.01, confidence: 1.00, lift: 3.16
--------------------------------------------------------------------------------
LHS: ['Distance', 'Social smoker', 'Children'] --> RHS:['Social drinker', 'Target Achieved'], support: 0.01, confidence: 1.00, lift: 1.98
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Social smoker', 'Children'] --> RHS:['Distance', 'Target Achieved'], support: 0.01, confidence: 0.62, lift: 2.17
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Distance', 'Social smoker'] --> RHS:['Target Achieved', 'Children'], support: 0.01, confidence: 1.00, lift: 1.83
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Distance', 'Social smoker', 'Children'] --> RHS:['Target Achieved'], support: 0.01, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Higher Education'] --> RHS:['Target Achieved', 'Pet', 'Children'], support: 0.01, confidence: 1.00, lift: 2.89
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Higher Education', 'Children'] --> RHS:['Target Achieved', 'Pet'], support: 0.01, confidence: 1.00, lift: 2.84
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Higher Education', 'Pet'] --> RHS:['Target Achieved', 'Children'], support: 0.01, confidence: 1.00, lift: 1.83
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Higher Education', 'Pet', 'Children'] --> RHS:['Target Achieved'], support: 0.01, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: ['Age Above 50', ' Healthy Weight'] --> RHS:['Distance', 'Target Achieved', 'Pet', 'Children'], support: 0.01, confidence: 0.67, lift: 14.10
--------------------------------------------------------------------------------
LHS: ['Age Above 50', 'Pet'] --> RHS:['Distance', 'Target Achieved', ' Healthy Weight', 'Children'], support: 0.01, confidence: 0.89, lift: 11.54
--------------------------------------------------------------------------------
LHS: ['Age Above 50', ' Healthy Weight', 'Children'] --> RHS:['Distance', 'Target Achieved', 'Pet'], support: 0.01, confidence: 0.89, lift: 18.79
--------------------------------------------------------------------------------
LHS: ['Age Above 50', 'Distance', ' Healthy Weight'] --> RHS:['Target Achieved', 'Pet', 'Children'], support: 0.01, confidence: 0.73, lift: 2.10
--------------------------------------------------------------------------------
LHS: ['Age Above 50', 'Pet', ' Healthy Weight'] --> RHS:['Distance', 'Target Achieved', 'Children'], support: 0.01, confidence: 0.89, lift: 5.26
--------------------------------------------------------------------------------
LHS: ['Distance', 'Pet', ' Healthy Weight'] --> RHS:['Age Above 50', 'Target Achieved', 'Children'], support: 0.01, confidence: 1.00, lift: 19.47
--------------------------------------------------------------------------------
LHS: ['Age Above 50', 'Pet', 'Children'] --> RHS:['Distance', 'Target Achieved', ' Healthy Weight'], support: 0.01, confidence: 0.89, lift: 7.39
--------------------------------------------------------------------------------
LHS: ['Age Above 50', 'Distance', 'Pet'] --> RHS:['Target Achieved', ' Healthy Weight', 'Children'], support: 0.01, confidence: 1.00, lift: 2.95
--------------------------------------------------------------------------------
LHS: ['Age Above 50', 'Distance', ' Healthy Weight', 'Children'] --> RHS:['Target Achieved', 'Pet'], support: 0.01, confidence: 1.00, lift: 2.84
--------------------------------------------------------------------------------
LHS: ['Age Above 50', 'Pet', ' Healthy Weight', 'Children'] --> RHS:['Distance', 'Target Achieved'], support: 0.01, confidence: 0.89, lift: 3.13
--------------------------------------------------------------------------------
LHS: ['Age Above 50', 'Distance', 'Pet', ' Healthy Weight'] --> RHS:['Target Achieved', 'Children'], support: 0.01, confidence: 1.00, lift: 1.83
--------------------------------------------------------------------------------
LHS: ['Distance', 'Pet', ' Healthy Weight', 'Children'] --> RHS:['Age Above 50', 'Target Achieved'], support: 0.01, confidence: 1.00, lift: 18.05
--------------------------------------------------------------------------------
LHS: ['Age Above 50', 'Distance', 'Pet', 'Children'] --> RHS:['Target Achieved', ' Healthy Weight'], support: 0.01, confidence: 1.00, lift: 2.04
--------------------------------------------------------------------------------
LHS: ['Children', ' Healthy Weight', 'Age Above 50', 'Distance', 'Pet'] --> RHS:['Target Achieved'], support: 0.01, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
LHS: ['Distance', 'Social smoker'] --> RHS:['Social drinker', 'Target Achieved', ' Healthy Weight', 'Children'], support: 0.01, confidence: 1.00, lift: 5.69
--------------------------------------------------------------------------------
LHS: ['Distance', 'Social smoker', ' Healthy Weight'] --> RHS:['Social drinker', 'Target Achieved', 'Children'], support: 0.01, confidence: 1.00, lift: 3.16
--------------------------------------------------------------------------------
LHS: ['Distance', 'Social smoker', 'Children'] --> RHS:['Social drinker', 'Target Achieved', ' Healthy Weight'], support: 0.01, confidence: 1.00, lift: 4.51
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Social smoker', 'Children'] --> RHS:['Distance', 'Target Achieved', ' Healthy Weight'], support: 0.01, confidence: 0.62, lift: 5.12
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Distance', 'Social smoker'] --> RHS:['Target Achieved', ' Healthy Weight', 'Children'], support: 0.01, confidence: 1.00, lift: 2.95
--------------------------------------------------------------------------------
LHS: ['Distance', 'Social smoker', ' Healthy Weight', 'Children'] --> RHS:['Social drinker', 'Target Achieved'], support: 0.01, confidence: 1.00, lift: 1.98
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Social smoker', ' Healthy Weight', 'Children'] --> RHS:['Distance', 'Target Achieved'], support: 0.01, confidence: 0.62, lift: 2.17
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Distance', 'Social smoker', ' Healthy Weight'] --> RHS:['Target Achieved', 'Children'], support: 0.01, confidence: 1.00, lift: 1.83
--------------------------------------------------------------------------------
LHS: ['Social drinker', 'Distance', 'Social smoker', 'Children'] --> RHS:['Target Achieved', ' Healthy Weight'], support: 0.01, confidence: 1.00, lift: 2.04
--------------------------------------------------------------------------------
LHS: ['Children', ' Healthy Weight', 'Social drinker', 'Distance', 'Social smoker'] --> RHS:['Target Achieved'], support: 0.01, confidence: 1.00, lift: 1.09
--------------------------------------------------------------------------------
In [28]:
!pip install plotly==5.10.0
Requirement already satisfied: plotly==5.10.0 in c:\users\adeol\anaconda3\lib\site-packages (5.10.0)
Requirement already satisfied: tenacity>=6.2.0 in c:\users\adeol\anaconda3\lib\site-packages (from plotly==5.10.0) (8.0.1)
In [29]:
rules_df = pd.DataFrame(associationRules,columns=['LHS','RHS','Support','Confidence','Lift'])
import plotly.express as px
fig = px.scatter(rules_df, x='Support', y='Confidence', color='Lift',
                hover_data=['LHS','RHS'], color_continuous_scale='agsunset')
fig.show()
In [30]:
Rules = list(apriori(Absentees, min_support=0.02, min_confidence=0.2, max_length=3))
associationRules = utils.extract(Rules)
rules_df = pd.DataFrame(associationRules, columns=['LHS', 'RHS', 'Support', 'Confidence', 'Lift'])

# Use lamba function for partial string match
rules_df[rules_df['RHS'].apply(lambda x: 'Children' in x)]
Out[30]:
LHS RHS Support Confidence Lift
1 [] [Children] 0.597297 0.597297 1.000000
6 [] [ Healthy Weight, Children] 0.358108 0.358108 1.000000
7 [ Healthy Weight] [Children] 0.358108 0.679487 1.137603
24 [Age Above 50] [Children] 0.058108 0.934783 1.565021
28 [Disciplinary Action] [Children] 0.041892 0.775000 1.297511
... ... ... ... ... ...
221 [Social drinker] [Target Achieved, Children] 0.316216 0.557143 1.017989
222 [Target Achieved] [Social drinker, Children] 0.316216 0.343612 0.952334
225 [Social drinker, Target Achieved] [Children] 0.316216 0.625668 1.047499
226 [Social smoker] [Target Achieved, Children] 0.063514 0.870370 1.590306
228 [Target Achieved, Social smoker] [Children] 0.063514 0.886792 1.484675

74 rows × 5 columns

In [31]:
Children_rules = rules_df[rules_df['RHS'].apply(lambda x: 'Children' in x)].sort_values(by=['Lift'], ascending=False)

Children_rules.head()
Out[31]:
LHS RHS Support Confidence Lift
196 [Social smoker] [Higher Education, Children] 0.027027 0.370370 5.075446
148 [Age Above 50] [Distance, Children] 0.056757 0.913043 4.791859
89 [Social smoker] [ Healthy Weight, Children] 0.055405 0.759259 2.120196
152 [Age Above 50] [Social drinker, Children] 0.045946 0.739130 2.048526
171 [Disciplinary Action] [Social drinker, Children] 0.035135 0.650000 1.801498
In [32]:
fig = px.scatter(Children_rules, x='Support', y='Confidence', color='Lift',
                hover_data=['LHS','RHS'], color_continuous_scale='agsunset')
fig.show()
In [ ]: